Add an offset field to the Seq model#163
Open
coord-e wants to merge 1 commit into
Open
Conversation
8b1d9a7 to
e14038b
Compare
Sequences now carry an `offset` in addition to `array` and `length`, letting several views share one underlying array while keeping their own logical start. Indexing reads `array[offset + i]`; `push` writes at `offset + length`; `empty`/`singleton` and freshly built array literals start at offset 0; and `concat` keeps the first sequence's offset and appends the second's elements right after it. The `concat_int_array` SMT definition and the select peephole are updated to thread the offset through, and the Vec and slice extern specs and their tests refer to the new field. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GzapTuen2mKHkkN3B7d8qi
aa50d26 to
0c6bb28
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR 3 of 4 restructuring #153. Stacked on top of #162.
Sequences now carry an
offsetin addition toarrayandlength, letting several views share one underlying array while keeping their own logical start.Details
array[offset + i];pushwrites atoffset + length;empty/singletonand freshly built array literals start at offset 0; andconcatkeeps the first sequence's offset and appends the second's elements right after it.concat_int_arraySMT definition and the select peephole thread the offset through.Validation
cargo build,cargo fmt --all -- --check,cargo clippy -- -D warningscargo test— Spacer-backed tests pass (unchanged set from earlier PRs).define-fun-recwas again ground-checked with z3 (non-zero offsets concatenate correctly). PCSat-backed tests require the CoAR Docker image and were not run here.Stack
concat_int_arraytakes sequence tuples (Make concat_int_array operate on sequence tuples #162)split_first/split_last(_mut)🤖 Generated with Claude Code
https://claude.ai/code/session_01GzapTuen2mKHkkN3B7d8qi
Generated by Claude Code